package thread;

import java.util.Scanner;

/**
 * Sleep阻塞
 * 静态方法
 *
 */
public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了...,请输入倒计时");
        Scanner scan = new Scanner(System.in);
        for (int i = scan.nextInt(); i > 0 ; i--) {
            System.out.println(i);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
        System.out.println("时间到");
    }
}
